﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace EzDesk.DevHelper.HtmlToAspx
{
    public static class TfCmd
    {
        public static string ExecuteCmd(string command)
        {
            var p = new Process();
            p.StartInfo.FileName = "cmd.exe";

            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardInput = true;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.CreateNoWindow = true;

            p.Start();
            p.StandardInput.WriteLine(command);

            p.StandardInput.WriteLine("exit");
            p.WaitForExit();

            string returnStr = p.StandardOutput.ReadToEnd();
            p.Close();

            return returnStr;
        }


    }
}
